<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // const let 更好 ，var 污染window
        console.log(a);//var 定义提升 值不提升 提升到全局作用域顶部
        console.log(pizza);//let const 不支持变量提升
        console.log(fn);//函数 变量和值都提升
        var a = 1;
        const pizza = '榴莲';
        function fn() {
            console.log('fn');
        }

    </script>
</body>

</html>